package day2;
import java.util.Scanner;
public class Day02_01 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        //输入处理
        float a = in.nextFloat();
        String str = in.nextLine();
        char b = str.charAt(1);

        int ret = 20;
        //是否加急
        if(b == 'y') ret += 5;
        //是否超出1
        if(a > 1) {
            float temp = a - (int)a ;
            //是否有小数
            if(temp != 0.0) ret += 1;
            ret  = ret + (int)a - 1;
        }
        System.out.println(ret);
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        float a = in.nextFloat();
        char b = in.next().charAt(0);

        int ret = 20;
        if(b == 'y') ret += 5;

        if(a > 1.0) {
            ret = ret  - 1 + (int)Math.ceil(a);
        }

        System.out.println(ret);
    }
}
//https://www.nowcoder.com/practice/41b42e7b3c3547e3acf8e90c41d98270?tpId=290&tqId=39852&ru=/exam/oj